package com.zyh.system.JDsupermarkt.domain;

/**
 * @Author zyh
 * @Date 2024/8/2 16:55
 * @Description 商品类
 */

public class Goods {
    private String goodsName;
    private Double goodsPrice;
    private String goodsColor;
    private Double goodsSize;
    private Integer stock;

    public Goods() {
    }

    public Goods( String goodsName, Double goodsPrice, String goodsColor, Double goodsSize, Integer stock) {
        this.goodsName = goodsName;
        this.goodsPrice = goodsPrice;
        this.goodsColor = goodsColor;
        this.goodsSize = goodsSize;
        this.stock = stock;
    }


    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Double getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(Double goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public String getGoodsColor() {
        return goodsColor;
    }

    public void setGoodsColor(String goodsColor) {
        this.goodsColor = goodsColor;
    }

    public Double getGoodsSize() {
        return goodsSize;
    }

    public void setGoodsSize(Double goodsSize) {
        this.goodsSize = goodsSize;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "goodsName='" + goodsName + '\'' +
                ", goodsPrice=" + goodsPrice +
                ", goodsColor='" + goodsColor + '\'' +
                ", goodsSize=" + goodsSize +
                ", stock=" + stock +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Goods goods = (Goods) o;

        if (goodsName != null ? !goodsName.equals(goods.goodsName) : goods.goodsName != null) return false;
        if (goodsPrice != null ? !goodsPrice.equals(goods.goodsPrice) : goods.goodsPrice != null) return false;
        if (goodsColor != null ? !goodsColor.equals(goods.goodsColor) : goods.goodsColor != null) return false;
        if (goodsSize != null ? !goodsSize.equals(goods.goodsSize) : goods.goodsSize != null) return false;
        return stock != null ? stock.equals(goods.stock) : goods.stock == null;
    }

    @Override
    public int hashCode() {
        int result = goodsName != null ? goodsName.hashCode() : 0;
        result = 31 * result + (goodsPrice != null ? goodsPrice.hashCode() : 0);
        result = 31 * result + (goodsColor != null ? goodsColor.hashCode() : 0);
        result = 31 * result + (goodsSize != null ? goodsSize.hashCode() : 0);
        result = 31 * result + (stock != null ? stock.hashCode() : 0);
        return result;
    }
}
